package com.example.admin.adapter;

import android.util.Log;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.example.admin.R;
import com.example.admin.SQLite.Complaint;
import com.example.admin.SQLite.Payment;
import com.example.admin.SQLite.SqLiteOpenHelper;
import com.example.admin.SQLite.User;
import com.example.admin.SQLite.feiyong;
import com.example.admin.bean.PersonalBean;
import com.orhanobut.hawk.Hawk;

import java.util.List;

public class AdminTab2dapter extends BaseQuickAdapter<feiyong, BaseViewHolder> {

    public AdminTab2dapter() {
        super(R.layout.item_tab2);
    }
    @Override
    protected void convert(BaseViewHolder helper, feiyong str) {
        helper.setText(R.id.tv1, str.feiyongShequ)
                .setText(R.id.tv5, str.feiyongStatu)
                .setText(R.id.tv0, str.feiyongHome);
        helper.addOnClickListener(R.id.tv5);

        SqLiteOpenHelper dbHelper = new SqLiteOpenHelper(mContext);
        List<User> list = dbHelper.getUserList();
        helper .setText(R.id.tv4,"");
        for (User user : list) {
            if (Hawk.contains("PersonalBean" + user.id)) {
                PersonalBean bean =Hawk.get("PersonalBean" + user.id);
                Log.e("的士大夫撒旦", "222222: "+str.toString());
                if (bean.ZZ.equals(str.feiyongShequ)&&bean.xq.equals(str.feiyongHome)){
                    Log.e("的士大夫撒旦", "11111: "+bean.toString());
                    helper .setText(R.id.tv4, bean.name);
                }
            }
        }


    }

}